<!DOCTYPE html>
<html lang="">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title><%= htmlWebpackPlugin.options.title %></title>
      <!-- 设置跟元素 font-size start -->
      <script type="text/javascript">
          !(function flexible(window, document) {
              let docEl = document.documentElement;
              let dpr = window.devicePixelRatio || 1;
              let pixelRatio = 1 / dpr;
              //通过js动态设置视口(viewport)
              let meta = document.createElement("meta")
              meta.setAttribute('content', "width=device-width,initial-scale=" + pixelRatio + ",minimum-scale=" + pixelRatio + ",maximum-scale=" + pixelRatio)
              document.getElementsByTagName("head")[0].prepend(meta);
              // adjust body font size
              function setBodyFontSize() {
                  if (document.body) {
                      document.body.style.fontSize = 16 * dpr + "px";
                  } else {
                      document.addEventListener("DOMContentLoaded", setBodyFontSize);
                  }
              }
              setBodyFontSize();
              // set 1rem = viewWidth / 10
              function setRemUnit() {
                  // var rem = docEl.clientWidth / 10;
                  var rem = docEl.clientWidth / (1440 / 100);
                  docEl.style.fontSize = rem + "px";
              }
              setRemUnit();
              // reset rem unit on page resize
              window.addEventListener("resize", setRemUnit);
              window.addEventListener("pageshow", function (e) {
                  if (e.persisted) {
                      setRemUnit();
                  }
              });
          })(window, document);
      </script>
      <style>
          *{
              margin: 0;
              padding: 0;
          }
      </style>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>
